package edu.ccut.saturn.studio.database.popup.action;

import java.util.List;


import edu.ccut.saturn.studio.core.util.action.SaturnAction;
import edu.ccut.saturn.studio.database.model.DBConnection;
import edu.ccut.saturn.studio.database.model.SaturnTree;
import edu.ccut.saturn.studio.database.ui.DBConnectView;
import edu.ccut.saturn.studio.database.ui.ManageConnectionDialog;

/**
 * 修改连接
 * 
 * @author 谷钰
 * @version 1.0 2008.12.06
 * 
 */
public class PropertyCfgAction extends SaturnAction {

	public void run() {
		List<SaturnTree> selecteds = DBConnectView.getInstance()
				.getCurrentSelections();

		if (selecteds != null) {
			for (SaturnTree selected : selecteds) {
				if (selected instanceof DBConnection) {
					ManageConnectionDialog manageconnectiondialog = new ManageConnectionDialog(
							getShell(), (DBConnection)selected);
					
					manageconnectiondialog.open();
					break;
				}
			}
		}
	}
}
